package com.dididoctor.patient.Ui;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.GridView;

/**
 * Created by mahuihuang on 15/4/6.
 */
public class TagsGridView extends GridView {
    private boolean isIntercept = true;

    public TagsGridView(Context context) {
        this(context, null);
    }

    public TagsGridView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }


    public TagsGridView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }


    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return false;//
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        return isIntercept;//
    }

    public void setIsIntercept(boolean isIntercept) {
        this.isIntercept = isIntercept;
    }
}
